import { createRouter, createWebHistory } from 'vue-router'
import AdminLayout from '../views/AdminLayout.vue'
import Dashboard from '../views/Dashboard.vue'
import UserManagement from '../views/UserManagement.vue'
import AnalyticsOverview from '../views/AnalyticsOverview.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/dashboard'
    },
    {
      path: '/',
      component: AdminLayout,
      children: [
        {
          path: 'dashboard',
          name: 'Dashboard',
          component: Dashboard
        },
        {
          path: 'analytics/overview',
          name: 'AnalyticsOverview',
          component: AnalyticsOverview
        },
        {
          path: 'analytics/report',
          name: 'AnalyticsReport',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'commerce/products',
          name: 'Products',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'commerce/orders',
          name: 'Orders',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'content/articles',
          name: 'Articles',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'content/categories',
          name: 'Categories',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'report/daily',
          name: 'DailyReport',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'report/monthly',
          name: 'MonthlyReport',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'storage/archived',
          name: 'ArchivedStorage',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'operations/services',
          name: 'Services',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'operations/monitor',
          name: 'Monitor',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'system/users',
          name: 'SystemUsers',
          component: UserManagement
        },
        {
          path: 'system/roles',
          name: 'SystemRoles',
          component: () => import('../views/PagePlaceholder.vue')
        },
        {
          path: 'system/logs',
          name: 'SystemLogs',
          component: () => import('../views/PagePlaceholder.vue')
        }
      ]
    }
  ]
})

export default router
